#ifndef _MY_TIME_H_
#define _MY_TIME_H_



#define ARCH_OS_TIMER_OPT_BLOCK_MS_MAX		10*1000


typedef enum os_timer_reload {
	/* 创建一个射击定时器。到期后进入休眠模式 */
	ARCH_OS_TIMER_ONE_SHOT,
	/* 创建一个定期计时器。计时器到期后将自动重新加载 */
	ARCH_OS_TIMER_PERIODIC,
} arch_os_timer_reload_t;


typedef enum os_timer_activate {
	/** 在创建时启动计时器 */
	ARCH_OS_TIMER_AUTO_ACTIVATE,
	/** 创建时不要启动计时器 */
	ARCH_OS_TIMER_NO_ACTIVATE,
} arch_os_timer_activate_t;



int arch_os_timer_create(TimerHandle_t* ptimer, const char *name, uint32_t ms,
		    void (*call_back)(TimerHandle_t), void *context,
		    arch_os_timer_reload_t reload,
		    arch_os_timer_activate_t activate);

int arch_os_timer_deactivate(TimerHandle_t timer);


int arch_os_timer_activate(TimerHandle_t timer);

int arch_os_timer_change(TimerHandle_t timer, uint32_t ms);

int arch_os_timer_is_active(TimerHandle_t timer);

void *arch_os_timer_get_context(TimerHandle_t timer);


#endif

